package com.example.moble2021606143cwj0415;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    private RecyclerView rvMainpeople;
    private String[] names={"张云雷","秦霄贤","张九南","尚九熙","张鹤伦","郭麒麟"};
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        rvMainpeople.setLayoutManager(new LinearLayoutManager(this));
        PeopleAdapter adapter = new PeopleAdapter(names);
        rvMainpeople.setAdapter(adapter);
    }
    private void  initView() {
        rvMainpeople = (RecyclerView) findViewById(R.id.rv_main_people);
    }
}